package com.chinaoly.baotou.feign;

import com.chinaoly.frm.core.entity.Result;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author
 * @date 2020-12-09 10:43:39
 */
@Slf4j
@Component
public class XtglHystrixFactory implements FallbackFactory<XtglFeignClient> {

    @Override
    public XtglFeignClient create(Throwable cause) {
        log.error("fallback; exception was: {}", cause.toString());
        return new HystrixXlglFallFactory() {
            @Override
            public Result queryListByDictType(String idCards) {
                return null;
            }
        };
    }

    interface HystrixXlglFallFactory extends XtglFeignClient {
    }
}